/*
 * CGameStateMachine.h
 *
 *  Created on: Aug 31, 2011
 *      Author: welcome
 */

#ifndef CGAMESTATEMACHINE_H_
#define CGAMESTATEMACHINE_H_

#include <stdexcept>

namespace GGEngine {

enum States
{
    SM_STATE_UNKNOWN = -1
};

class CGameStateMachine: public acObject {

public:
	CGameStateMachine();

	virtual ~CGameStateMachine();

	void ScheduleStateChange(KDint nextState, KDint delay);

	// returns the current state

	KDint GetState() {
		return currentState;
	}

	// update the state, if return value is true a state change has occurred
	bool Tick();

	// returns the time for the next scheduled change

	KDtime GetScheduledTime() {

		return scheduledTime;

	}
private:
	KDint currentState;

	KDint nextState;

	KDtime scheduledTime;

	bool** stateMatrix;
};

} /* namespace GGE */
#endif /* CGAMESTATEMACHINE_H_ */
